using Gateway.Common.Entity;

namespace Gateway.Domain.Entities;

/// <summary>
/// 请求日志
/// </summary>
public class RequestLog : AggregateRootEntityBase
{
    public RequestLog()
    {
    }

    public RequestLog(string logType = default, string logName = default, string apiPath = default,
        string httpMethod = default,
        string ip = default, string @event = default, DateTime createdTime = default, string creatorName = default,
        string creatorBy = default)
    {
        LogType = logType;
        LogName = logName;
        ApiPath = apiPath;
        HttpMethod = httpMethod;
        Ip = ip;
        Event = @event;
        SetCreate(creatorBy, creatorName, createdTime);
    }

    /// <summary>
    /// 日志类型
    /// </summary>
    public string LogType { get; set; }

    /// <summary>
    /// 日志名称
    /// </summary>
    public string LogName { get; set; }

    /// <summary>
    /// 请求路径
    /// </summary>
    public string ApiPath { get; set; }

    /// <summary>
    /// 请求方法 http method POST GET PUT DELETE
    /// </summary>
    public string HttpMethod { get; set; }

    /// <summary>
    /// 客户端ip
    /// </summary>
    public string Ip { get; set; }

    /// <summary>
    /// 日志具体的内容
    /// </summary>
    public string Event { get; set; }
}